<template>

  <div class="echart-box" ref="chartRef"></div>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { useEcharts } from './use-echarts';


const chartRef = ref<HTMLElement | null>(null);
const {
  renderEcharts,
  resize,
  getChartInstance,
} = useEcharts(chartRef);

onMounted(() => {
  renderEcharts({
    xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        data: [150, 230, 224, 218, 135, 147, 260],
        type: 'line'
      }
    ]
  });
});
</script>
<style scoped lang="scss">
.echart-box {
  width: 100%;
  height: 400px;
}
</style>